import axios from 'axios'
export const state = () => ({
    counter: 0,
    today_weather:[]
})

export const mutations = {
    increment (state) {
        state.counter++
    },
    getweather (state,weatherarr) {
        state.today_weather = weatherarr
    }
}

export const actions = {
    async getweather ({ commit }) {
        let { data } = await axios.get('http://t.weather.sojson.com/api/weather/city/101030100')
        commit('getweather',data.data.forecast)
    }
}
